package com.gok.seasonmovie.service;

import com.gok.seasonmovie.entity.Comment;
import com.gok.seasonmovie.entity.CommentDTO;
import com.gok.seasonmovie.mapper.CommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CommentService {

    @Autowired
    private CommentMapper commentMapper;

    public void incrementLikeCount(String id) {
        commentMapper.incrementLikeCount(id);
    }
    public List<Comment> getAllComments() {
        return commentMapper.getAllComments();
    }

    public void insertComment(CommentDTO commentDTO){
        commentMapper.insertComment(commentDTO.getAvatarUrl(),commentDTO.getUsername(),commentDTO.getComment(),commentDTO.getDate(),commentDTO.getLocation());
    }
}
